#include("/template/common/layout/_page_layout.html")
#@layout()

#define css()
<style>

</style>
#end

#define js()
<script type="text/javascript">
    layui.use(['form', 'layer'], function () {
        // 操作对象
        var form = layui.form
            , layer = layui.layer
            , $ = layui.jquery;

        form.on('submit(sub)', function (data) {

            util.sendAjax({
                type: 'POST',
                url: '#(ctxPath)/system/user/postUpdate',
                data: $('#addForm').serialize(),
                loadFlag: true,
                success: function (data) {
                    pop_close();
                }
            });

            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
    });
</script>
#end

#define content()
<div class="x-body">
    <form id="addForm" class="layui-form" action="">
        <input type="hidden" name="user.id" value="#(user.id)">
        <div class="layui-form-item">
            <label class="layui-form-label"><em class="require-mark">*</em>用户帐号</label>
            <div class="layui-input-block">
                <input type="text" name="user.name" placeholder="用户帐号" class="layui-input" value="#(user.name)" required
                       lay-verify="required" style="width: 500px" autocomplete="off" disabled="disabled"/>
            </div>
        </div>

        <!--<div class="layui-form-item">-->
            <!--<label class="layui-form-label">登录密码</label>-->
            <!--<div class="layui-input-block">-->
                <!--<input type="text" name="user.pwd" placeholder="若不修改密码，无需输入" class="layui-input" value=""-->
                       <!--style="width: 500px" autocomplete="off"/>-->
            <!--</div>-->
        <!--</div>-->

        <div class="layui-form-item">
            <label class="layui-form-label">电话号码</label>
            <div class="layui-input-block">
                <input type="text" name="user.phone" placeholder="电话号码" class="layui-input" value="#(user.phone)"
                       style="width: 500px"  autocomplete="off" disabled="disabled"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">邮箱</label>
            <div class="layui-input-block">
                <input type="text" name="user.email" placeholder="邮箱" class="layui-input" value="#(user.email)"
                       style="width: 500px"  autocomplete="off" disabled="disabled"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">用户角色</label>
            <div class="layui-input-block">
                #for (role : roleList)
                <input type="checkbox" name="userRole" value="#(role.id)" disabled="disabled"
                       #for (userRole : userRoleList)
                       #(userRole.id== role.id ? 'checked' : '')
                #end
                title="#(role.name)">
                #end
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><em class="require-mark">*</em>状态</label>
            <div class="layui-input-block" style="width: 500px">
                <select id='status' name="user.status"  lay-verify="required" disabled="disabled">
                    <option></option>
                    #statusOption(io.jboot.admin.service.entity.status.system.UserStatus::me(), user.status)
                </select>
            </div>
        </div>

    </form>
</div>
#end